package cn.jingzhuan.fm.di.component

import cn.jingzhuan.fm.mvp.contract.FMAudioCommentContract
import cn.jingzhuan.fm.mvp.contract.FMAudioCommentSendContract
import cn.jingzhuan.fm.ui.activity.FMAudioCommentActivity
import cn.jingzhuan.fm.ui.fragment.FMAudioCommentSendFragment
import dagger.Module
import dagger.Provides
import dagger.Subcomponent
import dagger.android.AndroidInjector

/**
 * Created by Administrator on 2018/5/11.
 */

@Subcomponent(modules = [(FMAudioCommmentSendModule::class)])
interface FMAudioCommentSendComponent : AndroidInjector<FMAudioCommentSendFragment> {

    @Subcomponent.Builder
    abstract class Builder : AndroidInjector.Builder<FMAudioCommentSendFragment>() {
        abstract fun newModule(module : FMAudioCommmentSendModule):Builder

        override fun seedInstance(instance: FMAudioCommentSendFragment) {
            newModule(FMAudioCommmentSendModule(instance))
        }
    }
}

@Module
class FMAudioCommmentSendModule(val mView: FMAudioCommentSendContract.View) {
    @Provides
    fun getView() = mView
}